Skip to content

Conversation

Flash0ver
Copy link
Member

@Flash0ver Flash0ver commented Aug 21, 2025

Changes

Add Serilog integration to Sentry Structured Logging.

Docs

Dogfooding

  • getsentry/symbol-collector -> SymbolCollector.Server

@Flash0ver Flash0ver self-assigned this Aug 21, 2025
@Flash0ver Flash0ver added Serilog .NET Pull requests that update .net code Logs labels Aug 21, 2025
Copy link
Contributor

github-actions bot commented Aug 21, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against cdf0318

@Flash0ver
Copy link
Member Author

@sentry review

@Flash0ver Flash0ver marked this pull request as ready for review August 22, 2025 00:08

private void CaptureStructuredLog(IHub hub, LogEvent logEvent, string formatted, string? template)
{
var traceHeader = hub.GetTraceHeader() ?? SentryTraceHeader.Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the ParentSpanId required in the protocol for StructuredLogging? An empty SpanId probably isn't that useful otherwise eh?

Copy link
Member Author

@Flash0ver Flash0ver Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ... it's an optional "Default Attribute" ... the trace_id is required.

Oops ... I made this mistake in the Sentry-SDK and Microsoft.Extensions.Logging integrations, too.

I'll create a follow-up PR to fix this issue in all integrations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow-up for both the SDK-Logger and the Microsoft.Extensions.Logging integration: #4565

Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments, nothing blocking though. LGTM!

@Flash0ver Flash0ver merged commit bc5c060 into main Sep 25, 2025
33 checks passed
@Flash0ver Flash0ver deleted the feat/logs-serilog branch September 25, 2025 09:37
@Mike-E-angelo
Copy link

Woohoo, thank you again for your amazing efforts out there, @Flash0ver, @jamescrosswell, and team! This will really help out a lot with my projects. 🙏🙏🙏

@Syed-RI
Copy link

Syed-RI commented Sep 25, 2025

release the kraken, I mean nuget package, please? Also idiot proof (I'm the idiot) docs please ❤️

@Flash0ver
Copy link
Member Author

We got 4 Structured-Logs-related fixes in the pipeline, small yet impactful changes, that I'd like to ship in one release. With 3 developers working on these, I'm confident with releasing early next week. Also, docs are ready to be published too (getsentry/sentry-docs#14693).

@Flash0ver
Copy link
Member Author

Release: 5.16.0
Please let us know what you think: open an issue if you experience any problems, or start a discussion to share your thoughts

@Syed-RI
Copy link

Syed-RI commented Oct 2, 2025

@Flash0ver we we have to add Sentry.Serilog package and add that sink? I cant find it in the doc (told you I'm the idiot :P)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Logs .NET Pull requests that update .net code Serilog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants